package com.example.jwttoken.service.impl;

import com.example.jwttoken.mapper.UserMapper;
import com.example.jwttoken.pojo.User;
import com.example.jwttoken.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 功能描述:
 *
 * @ClassName: UserServiceImpl
 * @Author: ZhangHao
 * @Date: 2019-03-14 10:38
 * @Version: V1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User findUserById(String userId) {
        User user=userMapper.selectUserById(userId);
        return user;
    }

    @Override
    public User findByUsername(User user) {
        User user1 = userMapper.selectUserByNameAndPassword(user.getUsername(), user.getPassword());
        return user1;
    }
}
